package com.team.abs.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.team.abs.pojo.taskpojo;

@Transactional
@Service
public class taskinsertImpl implements taskinsert{
	@Autowired
	private taskinsert task_insert;
	@Override
	public int insert_task_id_user_id(int task_id, int user_id) {
		return this.task_insert.insert_task_id_user_id(task_id, user_id);
	}

	@Override
	public int insert_taskname_get_task_id(Map<String,Object> task) {
		return this.task_insert.insert_taskname_get_task_id(task);
	}

	@Override
	public List<taskpojo> get_taskname_by_user_id(int user_id) {
		return this.task_insert.get_taskname_by_user_id(user_id);
	}

	@Override
	public int del_task_id(int task_id) {
		return this.task_insert.del_task_id(task_id);
	}

	@Override
	public int insert_task_id_res_len(int task_id, String st) {
	
		return this.task_insert.insert_task_id_res_len(task_id, st);
	}

	@Override
	public int insert_task_id_res_emotion(int task_id, String st) {
		return this.task_insert.insert_task_id_res_emotion(task_id, st);
	}

	@Override
	public int insert_task_id_res_polar(int task_id, String st) {
		return this.task_insert.insert_task_id_res_polar(task_id, st);
	}

	@Override
	public int insert_task_id_res_top(int task_id, String st) {
		return this.task_insert.insert_task_id_res_top(task_id, st);
	}
	//这里可以用事务注解搞点操作
	public int insert_task_id_res(int task_id,List<String>list) {
		if(this.insert_task_id_res_len(task_id, list.get(0))<=0)
			return -1;
		if(this.insert_task_id_res_emotion(task_id, list.get(1))<=0)
			return -1;
		if(this.insert_task_id_res_polar(task_id, list.get(2))<=0)
			return -1;
		if(this.insert_task_id_res_top(task_id, list.get(3))<=0)
			return -1;
		return 1;
	}

	@Override
	public int insert_task_id_res_title(int task_id, String st) {
		return this.task_insert.insert_task_id_res_title(task_id, st);
	}

}
